<?php
class front_headerSticker extends Nine_Sticker
{
	public function run()
	{
		
		$menus = array(
			0 => array(
				'url' => Nine_Registry::getBaseUrl(),
				'name' => Nine_Language::translate('Home'),
				'id' => 'home'
				),
			1 => array(
				'url' => Nine_Registry::getBaseUrl().'contact/index/join',
				'name' => Nine_Language::translate('Join us'),
				'id' => 'join'
				),
			2 => array(
				'url' => Nine_Route::_('contact/index/join'),
				'name' => Nine_Language::translate('Source'),
				'id' => 'source'
				),
			3 => array(
				'url' => Nine_Registry::getBaseUrl().'contact/index/works',
				'name' => Nine_Language::translate('Our Works'),
				'id' => 'works'
				),
			4 => array(
				'url' => Nine_Registry::getBaseUrl().'contact/index/about',
				'name' => Nine_Language::translate('About'),
				'id' => 'about'
				)
			);
// 		echo "<pre>";print_r($menus);die;
		/**
		 * Assign to view
		 */
		$this->view->menus = $menus;
		$currentLink = @rtrim(Nine_Registry::getConfig('liveSite'),'/').'/'. substr($_SERVER['REQUEST_URI'], strlen(Nine_Registry::getBaseUrl()));
		$this->view->currentLink = urlencode($currentLink);
		
		/**
		 * Title
		 */
		@preg_match('/\<title\>(.*)\<\/title\>/', $this->view->headTitle->toString(), $matches);
		$this->view->currentTitle = urlencode(@$matches[1]);
		
	}
}